﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pai.LiveStation
{
    public enum MediaType
    {
        Show,
        Advertisement,
        Music
    }

    public abstract class MediaBase
    {
        private string mediaName;
        private string mediaDescription;
        private MediaType mediaType;
        private string mediaLocation;
        private List<string> mediaGenres;
        private List<string> mediaTags;
        private DateTime mediaDateCreated;
        private DateTime mediaDatePublished;
        private List<string> mediaAuthors;
        private string mediaCopyright;

        public string Name { get { return mediaName; } set { mediaName = value; } }
        public string Description { get { return mediaDescription; } set { mediaDescription = value; } }
        public List<string> Authors {get{return mediaAuthors;} set{mediaAuthors = value;}}
        public MediaType Type { get { return mediaType; } set { mediaType = value; } }
        public string Location { get { return mediaLocation; } set { mediaLocation = value; } }
        public List<string> Genres { get { return mediaGenres; } set { mediaGenres = value; } }
        public List<string> Tags { get { return mediaTags; } set { mediaTags = value; } }
        public DateTime DateCreated { get { return mediaDateCreated; } set { mediaDateCreated = value; } }
        public DateTime DatePublished { get { return mediaDatePublished; } set { mediaDatePublished = value; } }
        public string Copyright { get { return mediaCopyright; } set { mediaCopyright = value; } }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("\"");
            sb.Append(mediaName);
            sb.Append("\"");
            sb.Append(" - ");
            sb.Append(mediaDescription);
            sb.Append("by ");
            sb.Append(String.Join(" ,", mediaAuthors.ToArray()));
            sb.Append(" (");
            if (mediaDatePublished != null)
                sb.Append(mediaDatePublished.ToShortDateString());
            else
                sb.Append("N/A");
            sb.Append(")");
            return sb.ToString();
        }  
    }
}
